home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_24_Call Sprite Handler.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  1.0 KB  |  47 lines

  1. property whichevent, Addressee, EventToSend
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   addProp(description, #whichevent, [#default: #mouseUp, #format: #symbol, #comment: "On Which Event:", #range: [#mouseUp, #mouseDown, #enterFrame, #exitFrame]])
  6.   addProp(description, #Addressee, [#default: 1, #format: #integer, #comment: "Which Sprite Gets the Event:"])
  7.   addProp(description, #EventToSend, [#default: #generic_event, #format: #symbol, #comment: "Event To Send:"])
  8.   return description
  9. end
  10.  
  11. on getBehaviorDescription
  12.   return "Send an event to a sprite"
  13. end
  14.  
  15. on getAssocMembers
  16.   set myPropList to []
  17.   return myPropList
  18. end
  19.  
  20. on do_it me
  21.   call(the Addressee of me, the EventToSend of me)
  22. end
  23.  
  24. on mouseUp me
  25.   if the whichevent of me = #mouseUp then
  26.     do_it(me)
  27.   end if
  28. end
  29.  
  30. on mouseDown me
  31.   if the whichevent of me = #mouseDown then
  32.     do_it(me)
  33.   end if
  34. end
  35.  
  36. on enterFrame me
  37.   if the whichevent of me = #enterFrame then
  38.     do_it(me)
  39.   end if
  40. end
  41.  
  42. on exitFrame me
  43.   if the whichevent of me = #exitFrame then
  44.     do_it(me)
  45.   end if
  46. end
  47.